export default {
  install(Vue, options) {
    // Vue.prototype.setlStorage = function (key, val) {
    //     localStorage.setItem(key, val);
    //   },
    //   Vue.prototype.getlStorage = function (key) {
    //     localStorage.getItem(key);
    //   },
    //   Vue.prototype.removeLStorage = function (key) {
    //     localStorage.removeItem(key);
    //   },
    //   Vue.prototype.setsStorage = function (key, val) {
    //     sessionStorage.setItem(key, val);
    //   },
    //   Vue.prototype.getsStorage = function (key) {
    //     sessionStorage.getItem(key);
    //   },
    //   Vue.prototype.removesStorage = function (key) {
    //     sessionStorage.removeItem(key);
    //   }
    Vue.prototype.toPage = function (param) {
        var getObj = JSON.parse(sessionStorage.getItem("toPage"));
        if (getObj) {
          console.log("读取缓存数据")
          sessionStorage.removeItem("toPage");
          return getObj;
        } else {
          console.log("默认操作")
          return false;
        }
      },
      Vue.prototype.fromPage = function (path, fullPath, query) {
        var setObj = {
          path: path,
          fullPath: fullPath,
          query: query
        };
        console.log("存数据")
        sessionStorage.setItem("toPage", JSON.stringify(setObj));
      }
  }
}
